import { createStoreBindings } from 'mobx-miniprogram-bindings'
import { store } from '../../store/store'

Page({
       //将createStoreBindings挂载到behaviors上
  behaviors: [createStoreBindings],
  data: {
  },
  onLoad: function (options) {
    this.storeBindings = createStoreBindings(this, {
      store,
      fields: ['numA', 'numB', 'sum'], //相当于把store中的这3个值获取到data中
      actions: ['updateNum1'],//相当于把store中的这方法获取到这里可以被调用
    })
  },
  btnHandler1(e) {
    console.log("e",e)
    this.updateNum1(e.target.dataset.step)
  },
  onUnload: function () {
    this.storeBindings.detroyStoreBindings()
  },


})